package spring.spring_affairs.server;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import spring.spring_affairs.mapper.userInfoMapper;
import spring.spring_affairs.model.userInfo;

@Service
@Transactional(propagation = Propagation.MANDATORY)
public class userInfoServer {
    @Autowired
    userInfoMapper userMapper;

    public void insertUserInfo(userInfo userInfo) {
        userMapper.insert(userInfo);
        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

//        throw new NullPointerException();

    }
}

